********************************************************************************
********************************************************************************
****** Replication Do-file: Marius Mehrl - Arming the new Sheriff in Town ******
*************************** Foreign Policy  Analysis ***************************
********************************************************************************
************ Do-file replicates all main and supplementary analyses ************
********************************************************************************
********************************************************************************

* Loading in data and final changes
log using replication-LOG.txt, replace text
use "C:\Users\...\armstransfer_data_dyadicorder", clear

xtset dyad year
btscs order year dyad, gen(timesinceorder)
btscs import_leadertrans year dyad, gen(import_leadertime)
btscs import_solschdum year dyad, gen(import_coalitiontime)

gen prev_suppl_5y=0
replace prev_suppl_5y=1 if l2.order==1 | l3.order==1 | l4.order==1 | l5.order==1 | l6.order==1

bysort ccode_supplier year: egen suppl_tot_active=total(order)
xtset dyad year
gen prev_nosuppl_5y=0
replace prev_nosuppl_5y=1 if l2.order==0 & l3.order==0 & l4.order==0 & l5.order==0 & l6.order==0 & l2.suppl_tot_active!=0 & l3.suppl_tot_active!=0 & l4.suppl_tot_active!=0 & l5.suppl_tot_active!=0 & l6.suppl_tot_active!=0

tab prev_suppl_5y prev_nosuppl_5y

sum order if l.import_leadertrans==0, d
sum order if l.import_solschdum==0, d

********************************************************************************
** Run main models (Previous suppliers (5 years)) for results in figures 1-3 **
********************************************************************************

* define sample
local sample prev_suppl_5y

* define controls (block 3 is for interactions, excludes other measure of importer regime type)
local controlblock2 l2.import_v2x_polyarchy l2.import_leadertime l.import_ln_milex l.import_ln_gdp l.import_ln_pop l.import_gmlmidongoing l.import_ucdpongoing l2.export_v2x_polyarchy l.export_ln_milex l.export_ln_gdp l.export_ln_pop l.export_gmlmidongoing l.export_ucdpongoing l.atop_defense l2.dist_polyarchy

local controlblock3 l2.import_leadertime l.import_ln_milex l.import_ln_gdp l.import_ln_pop l.import_gmlmidongoing l.import_ucdpongoing l2.export_v2x_polyarchy l.export_ln_milex l.export_ln_gdp l.export_ln_pop l.export_gmlmidongoing l.export_ucdpongoing l.atop_defense l2.dist_polyarchy

* Previous suppliers - any leader change
local treat l.import_leadertrans
reghdfe order `treat' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
margins, dydx(`treat') post
estimates store one_nofe_biv
reghdfe order `treat' `controlblock2' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
margins, dydx(`treat') post
estimates store one_nofe_contr
reghdfe order `treat' c.timesinceorder##c.timesinceorder##c.timesinceorder  if `sample'==1, absorb(dyad year) cluster(dyad)
margins, dydx(`treat') post
estimates store one_fe_biv
reghdfe order `treat' `controlblock2' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
margins, dydx(`treat') post
estimates store one_fe_contr

* Previous suppliers - SOLS leader change
local treat l.import_solschdum
reghdfe order `treat' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
margins, dydx(`treat') post
estimates store two_nofe_biv
reghdfe order `treat' `controlblock2' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
margins, dydx(`treat') post
estimates store two_nofe_contr
reghdfe order `treat' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
margins, dydx(`treat') post
estimates store two_fe_biv
reghdfe order `treat' `controlblock2' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
margins, dydx(`treat') post
estimates store two_fe_contr

* Previous suppliers - any leader change X Importer Autocracy
local treat l.import_leadertrans
local moder l2.import_gwf_autoc
reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store three_nofe_biv
reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store three_nofe_contr
reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store three_fe_biv
reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store three_fe_contr

* Previous suppliers - any leader change X Importer Personalist Autocracy
local treat l.import_leadertrans
local moder l2.imp_pers_topQ
reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store four_nofe_biv
reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store four_nofe_contr
reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store four_fe_biv
reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store four_fe_contr

* Previous suppliers - SOLS leader change X Autocracy
local treat l.import_solschdum
local moder l2.import_gwf_autoc
reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store five_nofe_biv
reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store five_nofe_contr
reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store five_fe_biv
reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store five_fe_contr

* Previous suppliers - SOLS leader change X Personalist Autocracy
local treat l.import_solschdum
local moder l2.imp_pers_topQ
reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store six_nofe_biv
reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store six_nofe_contr
reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store six_fe_biv
reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store six_fe_contr

* Figure 1 - no interactions
coefplot (one_nofe_biv, keep(L.import_leadertrans) offset(0.3) msymbol(O)) (one_nofe_contr, keep(L.import_leadertrans) offset(0.1) msymbol(D)) (one_fe_biv, keep(L.import_leadertrans) offset(-0.1) msymbol(T)) (one_fe_contr, keep(L.import_leadertrans) offset(-0.3) msymbol(S)) ///
(two_nofe_biv, keep(L.import_solschdum) offset(0.3) msymbol(O)) (two_nofe_contr, keep(L.import_solschdum) offset(0.1) msymbol(D)) (two_fe_biv, keep(L.import_solschdum) offset(-0.1) msymbol(T)) (two_fe_contr, keep(L.import_solschdum) offset(-0.3) msymbol(S)), ///
xline(0) scheme(plotplainblind) coeflabels(L.import_leadertrans="Leader Turnover" L.import_solschdum="Ruling Coalition Turnover") level(99 95) xlabel(#8) yscale(noline) mcolor(black) ciopts(lcolor(black black)) legend(position(6) row(1) order(3 "No FE, Bivariate" 6 "No FE, Controls" 9 "FE, Bivariate" 12 "FE, Controls") size(vsmall))
*graph export "C:\Users\mariu\Documents\Work\Research\arms transfers order delivery Data\Results Plots\leader_to_direct.png", as(png) name("Graph") replace

* Figure 2 - Leadership Turnover interactions
coefplot (three_nofe_biv, offset(0.3) msymbol(O) mcolor(red) ciopts(lcolor(red red))) (three_nofe_contr, offset(0.15) msymbol(D) mcolor(red) ciopts(lcolor(red red))) (three_fe_biv, offset(-0.1) msymbol(T) mcolor(red) ciopts(lcolor(red red))) (three_fe_contr, offset(-0.25) msymbol(S) mcolor(red) ciopts(lcolor(red red))) ///
(five_nofe_biv, offset(0.25) msymbol(O) mcolor(black) ciopts(lcolor(black black))) (five_nofe_contr, offset(0.1) msymbol(D) mcolor(black) ciopts(lcolor(black black))) (five_fe_biv, offset(-0.15) msymbol(T) mcolor(black) ciopts(lcolor(black black))) (five_fe_contr, offset(-0.3) msymbol(S) mcolor(black) ciopts(lcolor(black black))), ///
xline(0) scheme(plotplainblind) coeflabels(1._at="No" 2._at="Yes") level(99 95) xlabel(#8) yscale(noline) legend(position(6) row(2) order(- "Autocracy:" 3 "No FE, Bivariate" 6 "No FE, Controls" 9 "FE, Bivariate" 12 "FE, Controls" - "Personalist Autocracy:" 15 "No FE, Bivariate" 18 "No FE, Controls" 21 "FE, Bivariate" 24 "FE, Controls") size(vsmall)) title(Leadership Turnover)
*graph export "C:\Users\mariu\Documents\Work\Research\arms transfers order delivery Data\Results Plots\leader_to_interact.png", as(png) name("Graph") replace


* Figure 3 - Ruling Coalition Turnover interactions
coefplot (four_nofe_biv, offset(0.3) msymbol(O) mcolor(red) ciopts(lcolor(red red))) (four_nofe_contr, offset(0.15) msymbol(D) mcolor(red) ciopts(lcolor(red red))) (four_fe_biv, offset(-0.1) msymbol(T) mcolor(red) ciopts(lcolor(red red))) (four_fe_contr, offset(-0.25) msymbol(S) mcolor(red) ciopts(lcolor(red red))) ///
(six_nofe_biv, offset(0.25) msymbol(O) mcolor(black) ciopts(lcolor(black black))) (six_nofe_contr, offset(0.1) msymbol(D) mcolor(black) ciopts(lcolor(black black))) (six_fe_biv, offset(-0.15) msymbol(T) mcolor(black) ciopts(lcolor(black black))) (six_fe_contr, offset(-0.3) msymbol(S) mcolor(black) ciopts(lcolor(black black))), ///
xline(0) scheme(plotplainblind) coeflabels(1._at="No" 2._at="Yes") level(99 95) xlabel(#8) yscale(noline) legend(position(6) row(2) order(- "Autocracy:" 3 "No FE, Bivariate" 6 "No FE, Controls" 9 "FE, Bivariate" 12 "FE, Controls" - "Personalist Autocracy:" 15 "No FE, Bivariate" 18 "No FE, Controls" 21 "FE, Bivariate" 24 "FE, Controls") size(vsmall)) title(Ruling Coalition Turnover)
*graph export "C:\Users\mariu\Documents\Work\Research\arms transfers order delivery Data\Results Plots\sols_to_interact.png", as(png) name("Graph") replace


*****************************************************************************
*** Obtain 90% CIs for negligible effects comparison, cited in footnote 8 ***
*****************************************************************************
local sample prev_suppl_5y
local controlblock2 l2.import_v2x_polyarchy l2.import_leadertime l.import_ln_milex l.import_ln_gdp l.import_ln_pop l.import_gmlmidongoing l.import_ucdpongoing l2.export_v2x_polyarchy l.export_ln_milex l.export_ln_gdp l.export_ln_pop l.export_gmlmidongoing l.export_ucdpongoing l.atop_defense l2.dist_polyarchy
local treat l.import_solschdum

reghdfe order `treat' `controlblock2' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad) level(90)

sum order if `sample'==1 & `treat'==0

* SOLS change full model, fig 1 - 90% CIs: -0.0267234; -0.0024256
* SD in arms order of untreated obs: .434159
display 0.0267234/0.434159
display 0.0145745/0.434159


********************************************
**** Analyses for Fig.4 - Top suppliers ****
********************************************
xtset dyad year
gen ordercount_5y=l2.ordernumber+l3.ordernumber+l4.ordernumber+l5.ordernumber+l6.ordernumber
order ordercount_5y, after(ordernumber)
bysort ccode_recipient year: egen supplierrank_5y=rank(ordercount_5y), field
replace supplierrank_5y=. if ordercount_5y==0
order supplierrank_5y, after(ordercount_5y)

recode supplierrank_5y (1/3=1) (4/17=0), gen(top3supplier_5y)
recode supplierrank_5y (1=1) (2/17=0), gen(top1supplier_5y)

xtset dyad year
* Top 3 suppliers over previous 5 years
local sample top3supplier_5y

* define controls (block 3 is for interactions, excludes other measure of importer regime type)
local controlblock2 l2.import_v2x_polyarchy l2.import_leadertime l.import_ln_milex l.import_ln_gdp l.import_ln_pop l.import_gmlmidongoing l.import_ucdpongoing l2.export_v2x_polyarchy l.export_ln_milex l.export_ln_gdp l.export_ln_pop l.export_gmlmidongoing l.export_ucdpongoing l.atop_defense l2.dist_polyarchy

local controlblock3 l2.import_leadertime l.import_ln_milex l.import_ln_gdp l.import_ln_pop l.import_gmlmidongoing l.import_ucdpongoing l2.export_v2x_polyarchy l.export_ln_milex l.export_ln_gdp l.export_ln_pop l.export_gmlmidongoing l.export_ucdpongoing l.atop_defense l2.dist_polyarchy

* Previous Top 3 suppliers - any leader change
local treat l.import_leadertrans
reghdfe order `treat' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
margins, dydx(`treat') post
estimates store one_nofe_biv
reghdfe order `treat' `controlblock2' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
margins, dydx(`treat') post
estimates store one_nofe_contr
reghdfe order `treat' c.timesinceorder##c.timesinceorder##c.timesinceorder  if `sample'==1, absorb(dyad year) cluster(dyad)
margins, dydx(`treat') post
estimates store one_fe_biv
reghdfe order `treat' `controlblock2' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
margins, dydx(`treat') post
estimates store one_fe_contr

* Previous Top 3 suppliers - SOLS leader change
local treat l.import_solschdum
reghdfe order `treat' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
margins, dydx(`treat') post
estimates store two_nofe_biv
reghdfe order `treat' `controlblock2' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
margins, dydx(`treat') post
estimates store two_nofe_contr
reghdfe order `treat' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
margins, dydx(`treat') post
estimates store two_fe_biv
reghdfe order `treat' `controlblock2' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
margins, dydx(`treat') post
estimates store two_fe_contr

* Previous Top 3 suppliers - any leader change X Importer Autocracy
local treat l.import_leadertrans
local moder l2.import_gwf_autoc
reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store three_nofe_biv
reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store three_nofe_contr
reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store three_fe_biv
reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store three_fe_contr

* Previous Top 3 suppliers - any leader change X Importer Personalist Autocracy
local treat l.import_leadertrans
local moder l2.imp_pers_topQ
reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store four_nofe_biv
reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store four_nofe_contr
reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store four_fe_biv
reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store four_fe_contr

* Previous Top 3 suppliers - SOLS leader change X Autocracy
local treat l.import_solschdum
local moder l2.import_gwf_autoc
reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store five_nofe_biv
reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store five_nofe_contr
reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store five_fe_biv
reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store five_fe_contr

* Previous Top 3 suppliers - SOLS leader change X Personalist Autocracy
local treat l.import_solschdum
local moder l2.imp_pers_topQ
reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store six_nofe_biv
reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store six_nofe_contr
reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store six_fe_biv
reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store six_fe_contr

coefplot (one_nofe_biv, keep(L.import_leadertrans) offset(0.3) msymbol(O)) (one_nofe_contr, keep(L.import_leadertrans) offset(0.1) msymbol(D)) (one_fe_biv, keep(L.import_leadertrans) offset(-0.1) msymbol(T)) (one_fe_contr, keep(L.import_leadertrans) offset(-0.3) msymbol(S)) ///
(two_nofe_biv, keep(L.import_solschdum) offset(0.3) msymbol(O)) (two_nofe_contr, keep(L.import_solschdum) offset(0.1) msymbol(D)) (two_fe_biv, keep(L.import_solschdum) offset(-0.1) msymbol(T)) (two_fe_contr, keep(L.import_solschdum) offset(-0.3) msymbol(S)), ///
xline(0) scheme(plotplainblind) coeflabels(L.import_leadertrans="Leader Turnover" L.import_solschdum="RC Turnover") level(99 95) xlabel(#8) yscale(noline) mcolor(black) ciopts(lcolor(black black)) legend(position(6) row(1) order(3 "No FE, Bivariate" 6 "No FE, Controls" 9 "FE, Bivariate" 12 "FE, Controls") size(vsmall)) title(Top 3 Suppliers, size(small)) name(leader_to_direct_top3, replace)
*graph export "C:\Users\mariu\Documents\Work\Research\arms transfers order delivery Data\Results Plots\leader_to_direct_top3.png", as(png) name("Graph") replace

* Leadership Turnover
coefplot (three_nofe_biv, offset(0.3) msymbol(O) mcolor(red) ciopts(lcolor(red red))) (three_nofe_contr, offset(0.15) msymbol(D) mcolor(red) ciopts(lcolor(red red))) (three_fe_biv, offset(-0.1) msymbol(T) mcolor(red) ciopts(lcolor(red red))) (three_fe_contr, offset(-0.25) msymbol(S) mcolor(red) ciopts(lcolor(red red))) ///
(five_nofe_biv, offset(0.25) msymbol(O) mcolor(black) ciopts(lcolor(black black))) (five_nofe_contr, offset(0.1) msymbol(D) mcolor(black) ciopts(lcolor(black black))) (five_fe_biv, offset(-0.15) msymbol(T) mcolor(black) ciopts(lcolor(black black))) (five_fe_contr, offset(-0.3) msymbol(S) mcolor(black) ciopts(lcolor(black black))), ///
xline(0) scheme(plotplainblind) coeflabels(1._at="No" 2._at="Yes") level(99 95) xlabel(#8) yscale(noline) legend(position(6) row(2) order(- "Autocracy:" 3 "No FE, Bivariate" 6 "No FE, Controls" 9 "FE, Bivariate" 12 "FE, Controls" - "Personalist Autocracy:" 15 "No FE, Bivariate" 18 "No FE, Controls" 21 "FE, Bivariate" 24 "FE, Controls") size(vsmall)) title(Leadership Turnover - Top 3 Suppliers, size(small)) name(leader_to_interact_top3, replace)
*graph export "C:\Users\mariu\Documents\Work\Research\arms transfers order delivery Data\Results Plots\leader_to_interact_top3.png", as(png) name("Graph") replace


* Ruling Coalition Turnover
coefplot (four_nofe_biv, offset(0.3) msymbol(O) mcolor(red) ciopts(lcolor(red red))) (four_nofe_contr, offset(0.15) msymbol(D) mcolor(red) ciopts(lcolor(red red))) (four_fe_biv, offset(-0.1) msymbol(T) mcolor(red) ciopts(lcolor(red red))) (four_fe_contr, offset(-0.25) msymbol(S) mcolor(red) ciopts(lcolor(red red))) ///
(six_nofe_biv, offset(0.25) msymbol(O) mcolor(black) ciopts(lcolor(black black))) (six_nofe_contr, offset(0.1) msymbol(D) mcolor(black) ciopts(lcolor(black black))) (six_fe_biv, offset(-0.15) msymbol(T) mcolor(black) ciopts(lcolor(black black))) (six_fe_contr, offset(-0.3) msymbol(S) mcolor(black) ciopts(lcolor(black black))), ///
xline(0) scheme(plotplainblind) coeflabels(1._at="No" 2._at="Yes") level(99 95) xlabel(#8) yscale(noline) legend(position(6) row(2) order(- "Autocracy:" 3 "No FE, Bivariate" 6 "No FE, Controls" 9 "FE, Bivariate" 12 "FE, Controls" - "Personalist Autocracy:" 15 "No FE, Bivariate" 18 "No FE, Controls" 21 "FE, Bivariate" 24 "FE, Controls") size(vsmall)) title(Ruling Coalition Turnover - Top 3 Suppliers, size(small)) name(sols_to_interact_top3, replace)
*graph export "C:\Users\mariu\Documents\Work\Research\arms transfers order delivery Data\Results Plots\sols_to_interact_top3.png", as(png) name("Graph") replace


* Top supplier over previous 5 years
local sample top1supplier_5y

* define controls (block 3 is for interactions, excludes other measure of importer regime type)
local controlblock2 l2.import_v2x_polyarchy l2.import_leadertime l.import_ln_milex l.import_ln_gdp l.import_ln_pop l.import_gmlmidongoing l.import_ucdpongoing l2.export_v2x_polyarchy l.export_ln_milex l.export_ln_gdp l.export_ln_pop l.export_gmlmidongoing l.export_ucdpongoing l.atop_defense l2.dist_polyarchy

local controlblock3 l2.import_leadertime l.import_ln_milex l.import_ln_gdp l.import_ln_pop l.import_gmlmidongoing l.import_ucdpongoing l2.export_v2x_polyarchy l.export_ln_milex l.export_ln_gdp l.export_ln_pop l.export_gmlmidongoing l.export_ucdpongoing l.atop_defense l2.dist_polyarchy

* Previous Top 1 supplier - any leader change
local treat l.import_leadertrans
reghdfe order `treat' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
margins, dydx(`treat') post
estimates store one_nofe_biv
reghdfe order `treat' `controlblock2' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
margins, dydx(`treat') post
estimates store one_nofe_contr
reghdfe order `treat' c.timesinceorder##c.timesinceorder##c.timesinceorder  if `sample'==1, absorb(dyad year) cluster(dyad)
margins, dydx(`treat') post
estimates store one_fe_biv
reghdfe order `treat' `controlblock2' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
margins, dydx(`treat') post
estimates store one_fe_contr

* Previous Top 1 supplier - SOLS leader change
local treat l.import_solschdum
reghdfe order `treat' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
margins, dydx(`treat') post
estimates store two_nofe_biv
reghdfe order `treat' `controlblock2' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
margins, dydx(`treat') post
estimates store two_nofe_contr
reghdfe order `treat' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
margins, dydx(`treat') post
estimates store two_fe_biv
reghdfe order `treat' `controlblock2' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
margins, dydx(`treat') post
estimates store two_fe_contr

* Previous Top 1 supplier - any leader change X Importer Autocracy
local treat l.import_leadertrans
local moder l2.import_gwf_autoc
reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store three_nofe_biv
reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store three_nofe_contr
reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store three_fe_biv
reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store three_fe_contr

* Previous Top 1 supplier - any leader change X Importer Personalist Autocracy
local treat l.import_leadertrans
local moder l2.imp_pers_topQ
reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store four_nofe_biv
reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store four_nofe_contr
reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store four_fe_biv
reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store four_fe_contr

* Previous Top 1 supplier - SOLS leader change X Autocracy
local treat l.import_solschdum
local moder l2.import_gwf_autoc
reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store five_nofe_biv
reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store five_nofe_contr
reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store five_fe_biv
reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store five_fe_contr

* Previous Top 1 supplier - SOLS leader change X Personalist Autocracy
local treat l.import_solschdum
local moder l2.imp_pers_topQ
reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store six_nofe_biv
reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store six_nofe_contr
reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store six_fe_biv
reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
margins, dydx(`treat') at(`moder'=(0(1)1)) post
estimates store six_fe_contr

coefplot (one_nofe_biv, keep(L.import_leadertrans) offset(0.3) msymbol(O)) (one_nofe_contr, keep(L.import_leadertrans) offset(0.1) msymbol(D)) (one_fe_biv, keep(L.import_leadertrans) offset(-0.1) msymbol(T)) (one_fe_contr, keep(L.import_leadertrans) offset(-0.3) msymbol(S)) ///
(two_nofe_biv, keep(L.import_solschdum) offset(0.3) msymbol(O)) (two_nofe_contr, keep(L.import_solschdum) offset(0.1) msymbol(D)) (two_fe_biv, keep(L.import_solschdum) offset(-0.1) msymbol(T)) (two_fe_contr, keep(L.import_solschdum) offset(-0.3) msymbol(S)), ///
xline(0) scheme(plotplainblind) coeflabels(L.import_leadertrans="Leader Turnover" L.import_solschdum="RC Turnover") level(99 95) xlabel(#8) yscale(noline) mcolor(black) ciopts(lcolor(black black)) legend(position(6) row(1) order(3 "No FE, Bivariate" 6 "No FE, Controls" 9 "FE, Bivariate" 12 "FE, Controls") size(vsmall)) title(Top Supplier, size(small)) name(leader_to_direct_top1, replace)
*graph export "C:\Users\mariu\Documents\Work\Research\arms transfers order delivery Data\Results Plots\leader_to_direct_top1.png", as(png) name("Graph") replace

* Leadership Turnover
coefplot (three_nofe_biv, offset(0.3) msymbol(O) mcolor(red) ciopts(lcolor(red red))) (three_nofe_contr, offset(0.15) msymbol(D) mcolor(red) ciopts(lcolor(red red))) (three_fe_biv, offset(-0.1) msymbol(T) mcolor(red) ciopts(lcolor(red red))) (three_fe_contr, offset(-0.25) msymbol(S) mcolor(red) ciopts(lcolor(red red))) ///
(five_nofe_biv, offset(0.25) msymbol(O) mcolor(black) ciopts(lcolor(black black))) (five_nofe_contr, offset(0.1) msymbol(D) mcolor(black) ciopts(lcolor(black black))) (five_fe_biv, offset(-0.15) msymbol(T) mcolor(black) ciopts(lcolor(black black))) (five_fe_contr, offset(-0.3) msymbol(S) mcolor(black) ciopts(lcolor(black black))), ///
xline(0) scheme(plotplainblind) coeflabels(1._at="No" 2._at="Yes") level(99 95) xlabel(#8) yscale(noline) legend(position(6) row(2) order(- "Autocracy:" 3 "No FE, Bivariate" 6 "No FE, Controls" 9 "FE, Bivariate" 12 "FE, Controls" - "Personalist Autocracy:" 15 "No FE, Bivariate" 18 "No FE, Controls" 21 "FE, Bivariate" 24 "FE, Controls") size(vsmall)) title(Leadership Turnover - Top Supplier, size(small)) name(leader_to_interact_top1, replace)
*graph export "C:\Users\mariu\Documents\Work\Research\arms transfers order delivery Data\Results Plots\leader_to_interact_top1.png", as(png) name("Graph") replace


* Ruling Coalition Turnover
coefplot (four_nofe_biv, offset(0.3) msymbol(O) mcolor(red) ciopts(lcolor(red red))) (four_nofe_contr, offset(0.15) msymbol(D) mcolor(red) ciopts(lcolor(red red))) (four_fe_biv, offset(-0.1) msymbol(T) mcolor(red) ciopts(lcolor(red red))) (four_fe_contr, offset(-0.25) msymbol(S) mcolor(red) ciopts(lcolor(red red))) ///
(six_nofe_biv, offset(0.25) msymbol(O) mcolor(black) ciopts(lcolor(black black))) (six_nofe_contr, offset(0.1) msymbol(D) mcolor(black) ciopts(lcolor(black black))) (six_fe_biv, offset(-0.15) msymbol(T) mcolor(black) ciopts(lcolor(black black))) (six_fe_contr, offset(-0.3) msymbol(S) mcolor(black) ciopts(lcolor(black black))), ///
xline(0) scheme(plotplainblind) coeflabels(1._at="No" 2._at="Yes") level(99 95) xlabel(#8) yscale(noline) legend(position(6) row(2) order(- "Autocracy:" 3 "No FE, Bivariate" 6 "No FE, Controls" 9 "FE, Bivariate" 12 "FE, Controls" - "Personalist Autocracy:" 15 "No FE, Bivariate" 18 "No FE, Controls" 21 "FE, Bivariate" 24 "FE, Controls") size(vsmall)) title(Ruling Coalition Turnover - Top Supplier, size(small)) name(sols_to_interact_top1, replace)
*graph export "C:\Users\mariu\Documents\Work\Research\arms transfers order delivery Data\Results Plots\sols_to_interact_top1.png", as(png) name("Graph") replace

* Combine Top3 and Top 1 Supplier Results Plots -> this is figure 3 in paper
graph combine leader_to_direct_top3 leader_to_direct_top1 leader_to_interact_top3 leader_to_interact_top1 sols_to_interact_top3 sols_to_interact_top1, rows(3) scheme(plotplainblind) imargin(tiny) iscale(.45) ysize(8) xsize(5.5)
*graph export "C:\Users\mariu\Documents\Work\Research\arms transfers order delivery Data\Results Plots\top_suppliers.png", as(png) name("Graph") replace

**********************************************
********** Supplementary Materials ***********
**********************************************

* Table 1
sum order l.import_leadertrans l.import_solschdum top3supplier_5y top1supplier_5y l2.import_gwf_autoc l2.imp_pers_topQ l2.import_v2x_polyarchy l2.import_leadertime l.import_ln_milex l.import_ln_gdp l.import_ln_pop l.import_gmlmidongoing l.import_ucdpongoing l2.export_v2x_polyarchy l.export_ln_milex l.export_ln_gdp l.export_ln_pop l.export_gmlmidongoing l.export_ucdpongoing l.atop_defense l2.dist_polyarchy if prev_suppl_5y==1

* Tables 2-7
* define sample
local sample prev_suppl_5y

sum order l.import_leadertrans l.import_solschdum l2.import_gwf_autoc l2.imp_pers_topQ l2.import_v2x_polyarchy l2.import_leadertime l.import_ln_milex l.import_ln_gdp l.import_ln_pop l.import_gmlmidongoing l.import_ucdpongoing l2.export_v2x_polyarchy l.export_ln_milex l.export_ln_gdp l.export_ln_pop l.export_gmlmidongoing l.export_ucdpongoing l.atop_defense l2.dist_polyarchy if prev_suppl_5y==1


* define controls (block 3 is for interactions, excludes other measure of importer regime type)
local controlblock2 l2.import_v2x_polyarchy l2.import_leadertime l.import_ln_milex l.import_ln_gdp l.import_ln_pop l.import_gmlmidongoing l.import_ucdpongoing l2.export_v2x_polyarchy l.export_ln_milex l.export_ln_gdp l.export_ln_pop l.export_gmlmidongoing l.export_ucdpongoing l.atop_defense l2.dist_polyarchy

local controlblock3 l2.import_leadertime l.import_ln_milex l.import_ln_gdp l.import_ln_pop l.import_gmlmidongoing l.import_ucdpongoing l2.export_v2x_polyarchy l.export_ln_milex l.export_ln_gdp l.export_ln_pop l.export_gmlmidongoing l.export_ucdpongoing l.atop_defense l2.dist_polyarchy

* Previous suppliers - any leader change
est clear
local treat l.import_leadertrans
eststo: reghdfe order `treat' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat' `controlblock2' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat' c.timesinceorder##c.timesinceorder##c.timesinceorder  if `sample'==1, absorb(dyad year) cluster(dyad)
eststo: reghdfe order `treat' `controlblock2' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
*esttab using main_one, b(4) se(4) rtf replace star(** 0.05 *** 0.01) nogaps noomitted nodepvars drop(timesinceorder c.timesinceorder#c.timesinceorder c.timesinceorder#c.timesinceorder#c.timesinceorder) nonotes addnotes("Standard errors clustered on the country in parentheses. ** p < 0.05, *** p < 0.01") coeflabels(L.import_leadertrans "Leader Turnover") nomtitles

* Previous suppliers - SOLS leader change
est clear
local treat l.import_solschdum
eststo: reghdfe order `treat' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat' `controlblock2' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
eststo: reghdfe order `treat' `controlblock2' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
*esttab using main_two, b(4) se(4) rtf replace star(** 0.05 *** 0.01) nogaps noomitted nodepvars drop(timesinceorder c.timesinceorder#c.timesinceorder c.timesinceorder#c.timesinceorder#c.timesinceorder) nonotes addnotes("Standard errors clustered on the country in parentheses. ** p < 0.05, *** p < 0.01") coeflabels(L.import_solschdum "Ruling Coalition Turnover") nomtitles

* Previous suppliers - any leader change X Importer Autocracy
est clear
local treat l.import_leadertrans
local moder l2.import_gwf_autoc
eststo: reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
eststo: reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
*esttab using main_three, b(4) se(4) rtf replace star(** 0.05 *** 0.01) nogaps noomitted nodepvars drop(timesinceorder c.timesinceorder#c.timesinceorder c.timesinceorder#c.timesinceorder#c.timesinceorder) nonotes addnotes("Standard errors clustered on the country in parentheses. ** p < 0.05, *** p < 0.01") coeflabels(1L.import_leadertrans "Leader Turnover" 1.import_gwf_autoc "Autocracy" 1L.import_leadertrans#1.import_gwf_autoc "Turnover * Autocracy") nomtitles

* Previous suppliers - any leader change X Importer Personalist Autocracy
est clear
local treat l.import_leadertrans
local moder l2.imp_pers_topQ
eststo: reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
eststo: reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
*esttab using main_four, b(4) se(4) rtf replace star(** 0.05 *** 0.01) nogaps noomitted nodepvars drop(timesinceorder c.timesinceorder#c.timesinceorder c.timesinceorder#c.timesinceorder#c.timesinceorder) nonotes addnotes("Standard errors clustered on the country in parentheses. ** p < 0.05, *** p < 0.01") coeflabels(1L.import_leadertrans "Leader Turnover" 1.imp_pers_topQ "Personalist Autocracy" 1L.import_leadertrans#1.imp_pers_topQ "Turnover * Personalist Autocracy") nomtitles

* Previous suppliers - SOLS leader change X Autocracy
est clear
local treat l.import_solschdum
local moder l2.import_gwf_autoc
eststo: reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
eststo: reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
*esttab using main_five, b(4) se(4) rtf replace star(** 0.05 *** 0.01) nogaps noomitted nodepvars drop(timesinceorder c.timesinceorder#c.timesinceorder c.timesinceorder#c.timesinceorder#c.timesinceorder) nonotes addnotes("Standard errors clustered on the country in parentheses. ** p < 0.05, *** p < 0.01") coeflabels(1L.import_solschdum "Ruling Coalition Turnover" 1.import_gwf_autoc "Autocracy" 1L.import_solschdum#1.import_gwf_autoc "Turnover * Autocracy") nomtitles

* Previous suppliers - SOLS leader change X Personalist Autocracy
est clear
local treat l.import_solschdum
local moder l2.imp_pers_topQ
eststo: reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
eststo: reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
*esttab using main_six, b(4) se(4) rtf replace star(** 0.05 *** 0.01) nogaps noomitted nodepvars drop(timesinceorder c.timesinceorder#c.timesinceorder c.timesinceorder#c.timesinceorder#c.timesinceorder) nonotes addnotes("Standard errors clustered on the country in parentheses. ** p < 0.05, *** p < 0.01") coeflabels(1L.import_solschdum "Ruling Coalition Turnover" 1.imp_pers_topQ "Personalist Autocracy" 1L.import_solschdum#1.imp_pers_topQ "Turnover * Personalist Autocracy") nomtitles

* Tables 8-19
* Top 3
local sample top3supplier_5y

* define controls (block 3 is for interactions, excludes other measure of importer regime type)
local controlblock2 l2.import_v2x_polyarchy l2.import_leadertime l.import_ln_milex l.import_ln_gdp l.import_ln_pop l.import_gmlmidongoing l.import_ucdpongoing l2.export_v2x_polyarchy l.export_ln_milex l.export_ln_gdp l.export_ln_pop l.export_gmlmidongoing l.export_ucdpongoing l.atop_defense l2.dist_polyarchy

local controlblock3 l2.import_leadertime l.import_ln_milex l.import_ln_gdp l.import_ln_pop l.import_gmlmidongoing l.import_ucdpongoing l2.export_v2x_polyarchy l.export_ln_milex l.export_ln_gdp l.export_ln_pop l.export_gmlmidongoing l.export_ucdpongoing l.atop_defense l2.dist_polyarchy

* Top-3 suppliers - any leader change
est clear
local treat l.import_leadertrans
eststo: reghdfe order `treat' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat' `controlblock2' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat' c.timesinceorder##c.timesinceorder##c.timesinceorder  if `sample'==1, absorb(dyad year) cluster(dyad)
eststo: reghdfe order `treat' `controlblock2' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
*esttab using app_top3_one, b(4) se(4) rtf replace star(** 0.05 *** 0.01) nogaps noomitted nodepvars keep(L.import_leadertrans) nonotes addnotes("Standard errors clustered on the country in parentheses. ** p < 0.05, *** p < 0.01") coeflabels(L.import_leadertrans "Leader Turnover") nomtitles

* Top-3 suppliers - SOLS leader change
est clear
local treat l.import_solschdum
eststo: reghdfe order `treat' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat' `controlblock2' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
eststo: reghdfe order `treat' `controlblock2' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
*esttab using app_top3_two, b(4) se(4) rtf replace star(** 0.05 *** 0.01) nogaps noomitted nodepvars keep(L.import_solschdum) nonotes addnotes("Standard errors clustered on the country in parentheses. ** p < 0.05, *** p < 0.01") coeflabels(L.import_solschdum "Ruling Coalition Turnover") nomtitles

* Top-3 suppliers - any leader change X Importer Autocracy
est clear
local treat l.import_leadertrans
local moder l2.import_gwf_autoc
eststo: reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
eststo: reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
*esttab using app_top3_three, b(4) se(4) rtf replace star(** 0.05 *** 0.01) nogaps noomitted nodepvars keep(1L.import_leadertrans 1L2.import_gwf_autoc 1L.import_leadertrans#1L2.import_gwf_autoc) nonotes addnotes("Standard errors clustered on the country in parentheses. ** p < 0.05, *** p < 0.01") coeflabels(1L.import_leadertrans "Leader Turnover" 1.import_gwf_autoc "Autocracy" 1L.import_leadertrans#1.import_gwf_autoc "Turnover * Autocracy") nomtitles

* Top-3 suppliers - any leader change X Importer Personalist Autocracy
est clear
local treat l.import_leadertrans
local moder l2.imp_pers_topQ
eststo: reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
eststo: reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
*esttab using app_top3_four, b(4) se(4) rtf replace star(** 0.05 *** 0.01) nogaps noomitted nodepvars keep(1L.import_leadertrans 1L2.imp_pers_topQ 1L.import_leadertrans#1L2.imp_pers_topQ) nonotes addnotes("Standard errors clustered on the country in parentheses. ** p < 0.05, *** p < 0.01") coeflabels(1L.import_leadertrans "Leader Turnover" 1.imp_pers_topQ "Personalist Autocracy" 1L.import_leadertrans#1.imp_pers_topQ "Turnover * Personalist Autocracy") nomtitles

* Top-3 suppliers - SOLS leader change X Autocracy
est clear
local treat l.import_solschdum
local moder l2.import_gwf_autoc
eststo: reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
eststo: reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
*esttab using app_top3_five, b(4) se(4) rtf replace star(** 0.05 *** 0.01) nogaps noomitted nodepvars keep(1L.import_solschdum 1L2.import_gwf_autoc 1L.import_solschdum#1L2.import_gwf_autoc) nonotes addnotes("Standard errors clustered on the country in parentheses. ** p < 0.05, *** p < 0.01") coeflabels(1L.import_solschdum "Ruling Coalition Turnover" 1.import_gwf_autoc "Autocracy" 1L.import_solschdum#1.import_gwf_autoc "Turnover * Autocracy") nomtitles

* Top-3 suppliers - SOLS leader change X Personalist Autocracy
est clear
local treat l.import_solschdum
local moder l2.imp_pers_topQ
eststo: reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
eststo: reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
*esttab using app_top3_six, b(4) se(4) rtf replace star(** 0.05 *** 0.01) nogaps noomitted nodepvars keep(1L.import_solschdum 1L2.imp_pers_topQ 1L.import_solschdum#1L2.imp_pers_topQ) nonotes addnotes("Standard errors clustered on the country in parentheses. ** p < 0.05, *** p < 0.01") coeflabels(1L.import_solschdum "Ruling Coalition Turnover" 1.imp_pers_topQ "Personalist Autocracy" 1L.import_solschdum#1.imp_pers_topQ "Turnover * Personalist Autocracy") nomtitles

* Top 1
local sample top1supplier_5y

* define controls (block 3 is for interactions, excludes other measure of importer regime type)
local controlblock2 l2.import_v2x_polyarchy l2.import_leadertime l.import_ln_milex l.import_ln_gdp l.import_ln_pop l.import_gmlmidongoing l.import_ucdpongoing l2.export_v2x_polyarchy l.export_ln_milex l.export_ln_gdp l.export_ln_pop l.export_gmlmidongoing l.export_ucdpongoing l.atop_defense l2.dist_polyarchy

local controlblock3 l2.import_leadertime l.import_ln_milex l.import_ln_gdp l.import_ln_pop l.import_gmlmidongoing l.import_ucdpongoing l2.export_v2x_polyarchy l.export_ln_milex l.export_ln_gdp l.export_ln_pop l.export_gmlmidongoing l.export_ucdpongoing l.atop_defense l2.dist_polyarchy

* Top-1 suppliers - any leader change
est clear
local treat l.import_leadertrans
eststo: reghdfe order `treat' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat' `controlblock2' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat' c.timesinceorder##c.timesinceorder##c.timesinceorder  if `sample'==1, absorb(dyad year) cluster(dyad)
eststo: reghdfe order `treat' `controlblock2' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
*esttab using app_top1_one, b(4) se(4) rtf replace star(** 0.05 *** 0.01) nogaps noomitted nodepvars keep(L.import_leadertrans) nonotes addnotes("Standard errors clustered on the country in parentheses. ** p < 0.05, *** p < 0.01") coeflabels(L.import_leadertrans "Leader Turnover") nomtitles

* Top-1 suppliers - SOLS leader change
est clear
local treat l.import_solschdum
eststo: reghdfe order `treat' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat' `controlblock2' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
eststo: reghdfe order `treat' `controlblock2' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
*esttab using app_top1_two, b(4) se(4) rtf replace star(** 0.05 *** 0.01) nogaps noomitted nodepvars keep(L.import_solschdum) nonotes addnotes("Standard errors clustered on the country in parentheses. ** p < 0.05, *** p < 0.01") coeflabels(L.import_solschdum "Ruling Coalition Turnover") nomtitles

* Top-1 suppliers - any leader change X Importer Autocracy
est clear
local treat l.import_leadertrans
local moder l2.import_gwf_autoc
eststo: reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
eststo: reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
*esttab using app_top1_three, b(4) se(4) rtf replace star(** 0.05 *** 0.01) nogaps noomitted nodepvars keep(1L.import_leadertrans 1L2.import_gwf_autoc 1L.import_leadertrans#1L2.import_gwf_autoc) nonotes addnotes("Standard errors clustered on the country in parentheses. ** p < 0.05, *** p < 0.01") coeflabels(1L.import_leadertrans "Leader Turnover" 1.import_gwf_autoc "Autocracy" 1L.import_leadertrans#1.import_gwf_autoc "Turnover * Autocracy") nomtitles

* Top-1 suppliers - any leader change X Importer Personalist Autocracy
est clear
local treat l.import_leadertrans
local moder l2.imp_pers_topQ
eststo: reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
eststo: reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
*esttab using app_top1_four, b(4) se(4) rtf replace star(** 0.05 *** 0.01) nogaps noomitted nodepvars keep(1L.import_leadertrans 1L2.imp_pers_topQ 1L.import_leadertrans#1L2.imp_pers_topQ) nonotes addnotes("Standard errors clustered on the country in parentheses. ** p < 0.05, *** p < 0.01") coeflabels(1L.import_leadertrans "Leader Turnover" 1.imp_pers_topQ "Personalist Autocracy" 1L.import_leadertrans#1.imp_pers_topQ "Turnover * Personalist Autocracy") nomtitles

* Top-1 suppliers - SOLS leader change X Autocracy
est clear
local treat l.import_solschdum
local moder l2.import_gwf_autoc
eststo: reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
eststo: reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
*esttab using app_top1_five, b(4) se(4) rtf replace star(** 0.05 *** 0.01) nogaps noomitted nodepvars keep(1L.import_solschdum 1L2.import_gwf_autoc 1L.import_solschdum#1L2.import_gwf_autoc) nonotes addnotes("Standard errors clustered on the country in parentheses. ** p < 0.05, *** p < 0.01") coeflabels(1L.import_solschdum "Ruling Coalition Turnover" 1.import_gwf_autoc "Autocracy" 1L.import_solschdum#1.import_gwf_autoc "Turnover * Autocracy") nomtitles

* Top-1 suppliers - SOLS leader change X Personalist Autocracy
est clear
local treat l.import_solschdum
local moder l2.imp_pers_topQ
eststo: reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
eststo: reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
*esttab using app_top1_six, b(4) se(4) rtf replace star(** 0.05 *** 0.01) nogaps noomitted nodepvars keep(1L.import_solschdum 1L2.imp_pers_topQ 1L.import_solschdum#1L2.imp_pers_topQ) nonotes addnotes("Standard errors clustered on the country in parentheses. ** p < 0.05, *** p < 0.01") coeflabels(1L.import_solschdum "Ruling Coalition Turnover" 1.imp_pers_topQ "Personalist Autocracy" 1L.import_solschdum#1.imp_pers_topQ "Turnover * Personalist Autocracy") nomtitles

* tables 20-25
gen prev_suppl_3y=0
replace prev_suppl_3y=1 if l2.order==1 | l3.order==1 | l4.order==1

local sample prev_suppl_3y

local controlblock2 l2.import_v2x_polyarchy l2.import_leadertime l.import_ln_milex l.import_ln_gdp l.import_ln_pop l.import_gmlmidongoing l.import_ucdpongoing l2.export_v2x_polyarchy l.export_ln_milex l.export_ln_gdp l.export_ln_pop l.export_gmlmidongoing l.export_ucdpongoing l.atop_defense l2.dist_polyarchy

local controlblock3 l2.import_leadertime l.import_ln_milex l.import_ln_gdp l.import_ln_pop l.import_gmlmidongoing l.import_ucdpongoing l2.export_v2x_polyarchy l.export_ln_milex l.export_ln_gdp l.export_ln_pop l.export_gmlmidongoing l.export_ucdpongoing l.atop_defense l2.dist_polyarchy

* Previous suppliers (3 years) - any leader change
est clear
local treat l.import_leadertrans
eststo: reghdfe order `treat' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat' `controlblock2' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat' c.timesinceorder##c.timesinceorder##c.timesinceorder  if `sample'==1, absorb(dyad year) cluster(dyad)
eststo: reghdfe order `treat' `controlblock2' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
*esttab using app_one_3y, b(4) se(4) rtf replace star(* 0.1 ** 0.05 *** 0.01) nogaps noomitted nodepvars keep(L.import_leadertrans) nonotes addnotes("Standard errors clustered on the country in parentheses. * p < 0.1, ** p < 0.05, *** p < 0.01") coeflabels(L.import_leadertrans "Leader Turnover") nomtitles

* Previous suppliers (3 years) - SOLS leader change
est clear
local treat l.import_solschdum
eststo: reghdfe order `treat' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat' `controlblock2' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
eststo: reghdfe order `treat' `controlblock2' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
*esttab using app_two_3y, b(4) se(4) rtf replace star(* 0.1 ** 0.05 *** 0.01) nogaps noomitted nodepvars keep(L.import_solschdum) nonotes addnotes("Standard errors clustered on the country in parentheses. * p < 0.1, ** p < 0.05, *** p < 0.01") coeflabels(L.import_solschdum "Ruling Coalition Turnover") nomtitles

* Previous suppliers (3 years) - any leader change X Importer Autocracy
est clear
local treat l.import_leadertrans
local moder l2.import_gwf_autoc
eststo: reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
eststo: reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
*esttab using app_three_3y, b(4) se(4) rtf replace star(* 0.1 ** 0.05 *** 0.01) nogaps noomitted nodepvars keep(1L.import_leadertrans 1L2.import_gwf_autoc 1L.import_leadertrans#1L2.import_gwf_autoc) nonotes addnotes("Standard errors clustered on the country in parentheses. * p < 0.1, ** p < 0.05, *** p < 0.01") coeflabels(1L.import_leadertrans "Leader Turnover" 1.import_gwf_autoc "Autocracy" 1L.import_leadertrans#1.import_gwf_autoc "Turnover * Autocracy") nomtitles

* Previous suppliers (3 years) - any leader change X Importer Personalist Autocracy
est clear
local treat l.import_leadertrans
local moder l2.imp_pers_topQ
eststo: reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
eststo: reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
*esttab using app_four_3y, b(4) se(4) rtf replace star(* 0.1 ** 0.05 *** 0.01) nogaps noomitted nodepvars keep(1L.import_leadertrans 1L2.imp_pers_topQ 1L.import_leadertrans#1L2.imp_pers_topQ) nonotes addnotes("Standard errors clustered on the country in parentheses. * p < 0.1, ** p < 0.05, *** p < 0.01") coeflabels(1L.import_leadertrans "Leader Turnover" 1.imp_pers_topQ "Personalist Autocracy" 1L.import_leadertrans#1.imp_pers_topQ "Turnover * Personalist Autocracy") nomtitles

* Previous suppliers (3 years) - SOLS leader change X Autocracy
est clear
local treat l.import_solschdum
local moder l2.import_gwf_autoc
eststo: reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
eststo: reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
*esttab using app_five_3y, b(4) se(4) rtf replace star(* 0.1 ** 0.05 *** 0.01) nogaps noomitted nodepvars keep(1L.import_solschdum 1L2.import_gwf_autoc 1L.import_solschdum#1L2.import_gwf_autoc) nonotes addnotes("Standard errors clustered on the country in parentheses. * p < 0.1, ** p < 0.05, *** p < 0.01") coeflabels(1L.import_solschdum "Ruling Coalition Turnover" 1.import_gwf_autoc "Autocracy" 1L.import_solschdum#1.import_gwf_autoc "Turnover * Autocracy") nomtitles

* Previous suppliers (3 years) - SOLS leader change X Personalist Autocracy
est clear
local treat l.import_solschdum
local moder l2.imp_pers_topQ
eststo: reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
eststo: reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
*esttab using app_six_3y, b(4) se(4) rtf replace star(* 0.1 ** 0.05 *** 0.01) nogaps noomitted nodepvars keep(1L.import_solschdum 1L2.imp_pers_topQ 1L.import_solschdum#1L2.imp_pers_topQ) nonotes addnotes("Standard errors clustered on the country in parentheses. * p < 0.1, ** p < 0.05, *** p < 0.01") coeflabels(1L.import_solschdum "Ruling Coalition Turnover" 1.imp_pers_topQ "Personalist Autocracy" 1L.import_solschdum#1.imp_pers_topQ "Turnover * Personalist Autocracy") nomtitles

* tables 26-31
gen prev_suppl_10y=0
replace prev_suppl_10y=1 if l2.order==1 | l3.order==1 | l4.order==1 | l5.order==1 | l6.order==1 | l7.order==1 | l8.order==1 | l9.order==1 | l10.order==1 | l11.order==1

local sample prev_suppl_10y

local controlblock2 l2.import_v2x_polyarchy l2.import_leadertime l.import_ln_milex l.import_ln_gdp l.import_ln_pop l.import_gmlmidongoing l.import_ucdpongoing l2.export_v2x_polyarchy l.export_ln_milex l.export_ln_gdp l.export_ln_pop l.export_gmlmidongoing l.export_ucdpongoing l.atop_defense l2.dist_polyarchy

local controlblock3 l2.import_leadertime l.import_ln_milex l.import_ln_gdp l.import_ln_pop l.import_gmlmidongoing l.import_ucdpongoing l2.export_v2x_polyarchy l.export_ln_milex l.export_ln_gdp l.export_ln_pop l.export_gmlmidongoing l.export_ucdpongoing l.atop_defense l2.dist_polyarchy

* Previous suppliers (10 years) - any leader change
est clear
local treat l.import_leadertrans
eststo: reghdfe order `treat' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat' `controlblock2' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat' c.timesinceorder##c.timesinceorder##c.timesinceorder  if `sample'==1, absorb(dyad year) cluster(dyad)
eststo: reghdfe order `treat' `controlblock2' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
*esttab using app_one_10y, b(4) se(4) rtf replace star(* 0.1 ** 0.05 *** 0.01) nogaps noomitted nodepvars keep(L.import_leadertrans) nonotes addnotes("Standard errors clustered on the country in parentheses. * p < 0.1, ** p < 0.05, *** p < 0.01") coeflabels(L.import_leadertrans "Leader Turnover") nomtitles

* Previous suppliers (10 years) - SOLS leader change
est clear
local treat l.import_solschdum
eststo: reghdfe order `treat' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat' `controlblock2' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
eststo: reghdfe order `treat' `controlblock2' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
*esttab using app_two_10y, b(4) se(4) rtf replace star(* 0.1 ** 0.05 *** 0.01) nogaps noomitted nodepvars keep(L.import_solschdum) nonotes addnotes("Standard errors clustered on the country in parentheses. * p < 0.1, ** p < 0.05, *** p < 0.01") coeflabels(L.import_solschdum "Ruling Coalition Turnover") nomtitles

* Previous suppliers (10 years) - any leader change X Importer Autocracy
est clear
local treat l.import_leadertrans
local moder l2.import_gwf_autoc
eststo: reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
eststo: reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
*esttab using app_three_10y, b(4) se(4) rtf replace star(* 0.1 ** 0.05 *** 0.01) nogaps noomitted nodepvars keep(1L.import_leadertrans 1L2.import_gwf_autoc 1L.import_leadertrans#1L2.import_gwf_autoc) nonotes addnotes("Standard errors clustered on the country in parentheses. * p < 0.1, ** p < 0.05, *** p < 0.01") coeflabels(1L.import_leadertrans "Leader Turnover" 1.import_gwf_autoc "Autocracy" 1L.import_leadertrans#1.import_gwf_autoc "Turnover * Autocracy") nomtitles

* Previous suppliers (10 years) - any leader change X Importer Personalist Autocracy
est clear
local treat l.import_leadertrans
local moder l2.imp_pers_topQ
eststo: reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
eststo: reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
*esttab using app_four_10y, b(4) se(4) rtf replace star(* 0.1 ** 0.05 *** 0.01) nogaps noomitted nodepvars keep(1L.import_leadertrans 1L2.imp_pers_topQ 1L.import_leadertrans#1L2.imp_pers_topQ) nonotes addnotes("Standard errors clustered on the country in parentheses. * p < 0.1, ** p < 0.05, *** p < 0.01") coeflabels(1L.import_leadertrans "Leader Turnover" 1.imp_pers_topQ "Personalist Autocracy" 1L.import_leadertrans#1.imp_pers_topQ "Turnover * Personalist Autocracy") nomtitles

* Previous suppliers (10 years) - SOLS leader change X Autocracy
est clear
local treat l.import_solschdum
local moder l2.import_gwf_autoc
eststo: reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
eststo: reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
*esttab using app_five_10y, b(4) se(4) rtf replace star(* 0.1 ** 0.05 *** 0.01) nogaps noomitted nodepvars keep(1L.import_solschdum 1L2.import_gwf_autoc 1L.import_solschdum#1L2.import_gwf_autoc) nonotes addnotes("Standard errors clustered on the country in parentheses. * p < 0.1, ** p < 0.05, *** p < 0.01") coeflabels(1L.import_solschdum "Ruling Coalition Turnover" 1.import_gwf_autoc "Autocracy" 1L.import_solschdum#1.import_gwf_autoc "Turnover * Autocracy") nomtitles

* Previous suppliers (10 years) - SOLS leader change X Personalist Autocracy
est clear
local treat l.import_solschdum
local moder l2.imp_pers_topQ
eststo: reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, cluster(dyad)
eststo: reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
eststo: reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) cluster(dyad)
*esttab using app_six_10y, b(4) se(4) rtf replace star(* 0.1 ** 0.05 *** 0.01) nogaps noomitted nodepvars keep(1L.import_solschdum 1L2.imp_pers_topQ 1L.import_solschdum#1L2.imp_pers_topQ) nonotes addnotes("Standard errors clustered on the country in parentheses. * p < 0.1, ** p < 0.05, *** p < 0.01") coeflabels(1L.import_solschdum "Ruling Coalition Turnover" 1.imp_pers_topQ "Personalist Autocracy" 1L.import_solschdum#1.imp_pers_topQ "Turnover * Personalist Autocracy") nomtitles

* tables 32-37
****************************************************************
* Aronow et al. Dyadic Clustering SEs - these take time (~2h)! *
****************************************************************
local sample prev_suppl_5y

local controlblock2 l2.import_v2x_polyarchy l2.import_leadertime l.import_ln_milex l.import_ln_gdp l.import_ln_pop l.import_gmlmidongoing l.import_ucdpongoing l2.export_v2x_polyarchy l.export_ln_milex l.export_ln_gdp l.export_ln_pop l.export_gmlmidongoing l.export_ucdpongoing l.atop_defense l2.dist_polyarchy

local controlblock3 l2.import_leadertime l.import_ln_milex l.import_ln_gdp l.import_ln_pop l.import_gmlmidongoing l.import_ucdpongoing l2.export_v2x_polyarchy l.export_ln_milex l.export_ln_gdp l.export_ln_pop l.export_gmlmidongoing l.export_ucdpongoing l.atop_defense l2.dist_polyarchy

* Previous suppliers - Any leader change
local treat l.import_leadertrans
dcr reghdfe order `treat' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, dofadjust(none) dm1(ccode_recipient) dm2(ccode_supplier) dofundo(none)
*margins, dydx(`treat') post
*estimates store two_dcr_nofe_biv
dcr reghdfe order `treat' `controlblock2' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, dofadjust(none) dm1(ccode_recipient) dm2(ccode_supplier) dofundo(none)
*margins, dydx(`treat') post
*estimates store two_dcr_nofe_contr
dcr reghdfe order `treat' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) dofadjust(none) dm1(ccode_recipient) dm2(ccode_supplier) dofundo(none)
*margins, dydx(`treat') post
*estimates store two_dcr_fe_biv
dcr reghdfe order `treat' `controlblock2' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1,  absorb(dyad year) dofadjust(none) dm1(ccode_recipient) dm2(ccode_supplier) dofundo(none)
*margins, dydx(`treat') post
*estimates store two_dcr_fe_contr

* Previous suppliers - Any leader change X Autocracy
local treat l.import_leadertrans
local moder l2.import_gwf_autoc
dcr reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, dofadjust(none) dm1(ccode_recipient) dm2(ccode_supplier) dofundo(none)
*margins, dydx(`treat') at(`moder'=(0(1)1)) post
*estimates store five_dcr_nofe_biv
dcr reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, dofadjust(none) dm1(ccode_recipient) dm2(ccode_supplier) dofundo(none)
*margins, dydx(`treat') at(`moder'=(0(1)1)) post
*estimates store five_dcr_nofe_contr
dcr reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1,  absorb(dyad year) dofadjust(none) dm1(ccode_recipient) dm2(ccode_supplier) dofundo(none)
*margins, dydx(`treat') at(`moder'=(0(1)1)) post
*estimates store five_dcr_fe_biv
dcr reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1,  absorb(dyad year) dofadjust(none) dm1(ccode_recipient) dm2(ccode_supplier) dofundo(none)
*margins, dydx(`treat') at(`moder'=(0(1)1)) post
*estimates store five_dcr_fe_contr

* Previous suppliers - Any leader change X Personalist Autocracy
local treat l.import_leadertrans
local moder l2.imp_pers_topQ
dcr reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, dofadjust(none) dm1(ccode_recipient) dm2(ccode_supplier) dofundo(none)
*margins, dydx(`treat') at(`moder'=(0(1)1)) post
*estimates store six_dcr_nofe_biv
dcr reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, dofadjust(none) dm1(ccode_recipient) dm2(ccode_supplier) dofundo(none)
*margins, dydx(`treat') at(`moder'=(0(1)1)) post
*estimates store six_dcr_nofe_contr
dcr reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) dofadjust(none) dm1(ccode_recipient) dm2(ccode_supplier) dofundo(none)
*margins, dydx(`treat') at(`moder'=(0(1)1)) post
*estimates store six_dcr_fe_biv
dcr reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) dofadjust(none) dm1(ccode_recipient) dm2(ccode_supplier) dofundo(none)
*margins, dydx(`treat') at(`moder'=(0(1)1)) post
*estimates store six_dcr_fe_contr


local sample prev_suppl_5y

local controlblock2 l2.import_v2x_polyarchy l2.import_leadertime l.import_ln_milex l.import_ln_gdp l.import_ln_pop l.import_gmlmidongoing l.import_ucdpongoing l2.export_v2x_polyarchy l.export_ln_milex l.export_ln_gdp l.export_ln_pop l.export_gmlmidongoing l.export_ucdpongoing l.atop_defense l2.dist_polyarchy

local controlblock3 l2.import_leadertime l.import_ln_milex l.import_ln_gdp l.import_ln_pop l.import_gmlmidongoing l.import_ucdpongoing l2.export_v2x_polyarchy l.export_ln_milex l.export_ln_gdp l.export_ln_pop l.export_gmlmidongoing l.export_ucdpongoing l.atop_defense l2.dist_polyarchy
* Previous suppliers - SOLS leader change
local treat l.import_solschdum
dcr reghdfe order `treat' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, dofadjust(none) dm1(ccode_recipient) dm2(ccode_supplier) dofundo(none)
*margins, dydx(`treat') post
*estimates store two_dcr_nofe_biv
dcr reghdfe order `treat' `controlblock2' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, dofadjust(none) dm1(ccode_recipient) dm2(ccode_supplier) dofundo(none)
*margins, dydx(`treat') post
*estimates store two_dcr_nofe_contr
dcr reghdfe order `treat' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) dofadjust(none) dm1(ccode_recipient) dm2(ccode_supplier) dofundo(none)
*margins, dydx(`treat') post
*estimates store two_dcr_fe_biv
dcr reghdfe order `treat' `controlblock2' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1,  absorb(dyad year) dofadjust(none) dm1(ccode_recipient) dm2(ccode_supplier) dofundo(none)
*margins, dydx(`treat') post
*estimates store two_dcr_fe_contr

* Previous suppliers - SOLS leader change X Autocracy
local treat l.import_solschdum
local moder l2.import_gwf_autoc
dcr reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, dofadjust(none) dm1(ccode_recipient) dm2(ccode_supplier) dofundo(none)
*margins, dydx(`treat') at(`moder'=(0(1)1)) post
*estimates store five_dcr_nofe_biv
dcr reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, dofadjust(none) dm1(ccode_recipient) dm2(ccode_supplier) dofundo(none)
*margins, dydx(`treat') at(`moder'=(0(1)1)) post
*estimates store five_dcr_nofe_contr
dcr reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1,  absorb(dyad year) dofadjust(none) dm1(ccode_recipient) dm2(ccode_supplier) dofundo(none)
*margins, dydx(`treat') at(`moder'=(0(1)1)) post
*estimates store five_dcr_fe_biv
dcr reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1,  absorb(dyad year) dofadjust(none) dm1(ccode_recipient) dm2(ccode_supplier) dofundo(none)
*margins, dydx(`treat') at(`moder'=(0(1)1)) post
*estimates store five_dcr_fe_contr

* Previous suppliers - SOLS leader change X Personalist Autocracy
local treat l.import_solschdum
local moder l2.imp_pers_topQ
dcr reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, dofadjust(none) dm1(ccode_recipient) dm2(ccode_supplier) dofundo(none)
*margins, dydx(`treat') at(`moder'=(0(1)1)) post
*estimates store six_dcr_nofe_biv
dcr reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, dofadjust(none) dm1(ccode_recipient) dm2(ccode_supplier) dofundo(none)
*margins, dydx(`treat') at(`moder'=(0(1)1)) post
*estimates store six_dcr_nofe_contr
dcr reghdfe order `treat'##`moder' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) dofadjust(none) dm1(ccode_recipient) dm2(ccode_supplier) dofundo(none)
*margins, dydx(`treat') at(`moder'=(0(1)1)) post
*estimates store six_dcr_fe_biv
dcr reghdfe order `treat'##`moder' `controlblock3' c.timesinceorder##c.timesinceorder##c.timesinceorder if `sample'==1, absorb(dyad year) dofadjust(none) dm1(ccode_recipient) dm2(ccode_supplier) dofundo(none)
*margins, dydx(`treat') at(`moder'=(0(1)1)) post
*estimates store six_dcr_fe_contr

log close